import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { createStyleImportPlugin, VantResolve } from 'vite-plugin-style-import'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    createStyleImportPlugin({
      resolves:[ VantResolve() ],
      libs: [
        {
          libraryName: 'vant',
          esModule: true,
          // 这里路径安装官方文档设置可能 not found，需要根据自己的情况修改下
          resolveStyle: (name) => `../../vant/es/${name}/style/index`,
        },
      ]
    })
  ],
  resolve: {
    alias: {
      '@': '/src',
    },
  },
})
